#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string>
#include <iostream>
#include <unistd.h>
#include "common.hpp"
// 客户端
int main()
{
    int fd = open(FIFO_FILE, O_WRONLY);
    if (fd < 0)
    {
        std::cerr << "open fifo fail!" << std::endl;
    }
    while(true)
    {
        std::cout << "Please Enter # ";
        std::string message;
        std::cin >> message;

        int n = write(fd, message.c_str(), message.size());
        if(n > 0)
        {}
    }
    return 0;
}